#include "Logger.h"
#include <QDebug>

void Logger::log(const QString &fileName, const QString &message) {
    QString logMessage = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz ");
    logMessage += message;
    qDebug() << logMessage;

    QFile logFile(fileName);
    if (logFile.open(QIODevice::Append | QIODevice::Text)) {
        QTextStream out(&logFile);
        out << logMessage << "\n";
        logFile.close();
    }
}
